package service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import cn.johnmd5.JohnMd5;
import dao.StuDao;
import dao.impl.StuDaoImpl;
import service.StuManager;
import vo.Student;

@Service("sm")
@Scope
public class StuManagerImpl implements StuManager {
	//private StuDao sd = new StuDaoImpl();
	
	@Autowired(required=true)
	private StuDao sd ;
	@Override
	public Student login(String xh, String psd) {
		System.out.println(psd+"999999999999999999");
		//return sd.findStu(xh, JohnMd5.myMd5(psd, "md5"));
		return sd.findStu(xh, psd);
	}

	@Override
	public int regist(Student s) {
		//JohnMd5.myMd5(s.getPasswd(), "md5");
		
		return sd.addStu(s);
	}

}
